﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="renderer" content="webkit">
    <title>大众之旅</title>
    <link href="/static/home/css/normalize.css" rel="stylesheet">
    <link href="/static/home/css/bootatrap/bootstrap.min.css" rel="stylesheet">
    <link href="/static/home/css/mixin.css" rel="stylesheet">
    <link href="/static/home/css/style.css" rel="stylesheet">
    <style>
        .stars {  padding-left: 0;  overflow: hidden;border:unset !important; }
        .stars li {float: left;list-style: none;width: 16px;height: 16px;background: url(/static/home/img/star.jpg) no-repeat 0px 0px;padding:0 !important;border:unset !important;}
        .stars li a {  display: block;  width: 100%;  overflow: hidden; }
        .stars li .light {  background-position: 0 -29px; }
    </style>
</head>

<body>
    <!-- 头部 -->
    <header class="boder_bn">
        <div class="top">
            <div class="typearea">
                <div class="fl">
                    <span>欢迎来到大众之旅!</span>
                    <a href="{:url('login/login')}" class="login_ing"><span class="ml_15 color_o">请登录</span></a>
                    <a href="{:url('login/register')}" class="login_ing"><span class="ml_15">会员注册</span></a>
                    <a class="login_ed"><span class="ml_15 color_o">{if $Think.session.userinfo.username}{$Think.session.userinfo.username}{else}{$Think.session.userinfo.phone}{/if}</span></a>
                    <a class="login_ed login_out" style="cursor:pointer;"><span class="ml_15">退出!</span></a>
                </div>
                <div class="fr">
                    <a href="{:url('my/my')}#order"><span>我的订单</span></a>
                    <a href="{:url('my/my_cart')}"><span class="ml_30">我的购物车</span></a>
                </div>
            </div>
        </div>
        <div class="center">
            <div class="typearea">
                <div class="fl">
                    <img class="logo_img" src="/static/home/img/logo.png" alt="">
                </div>
                <div class="fr">
                    <div class="search input-group">
                        <input type="text" class="form-control" name="keyword">
                        <div class="search_btn btn-group">
                            <a id="search" class="btn">
                                <img src="/static/home/img/s.jpg" alt="">
                            </a>
                        </div>
                    </div>
                    <!-- <div class="mycart">
                        <img src="/static/home/img/cart.png" alt="">
                        <span>我的购物车(0)</span>
                    </div> -->
                </div>
            </div>
        </div>
        <div class="bottom">
            <div class="typearea">
                <div class="fl">
                    <!-- Single button -->
                    <div class="btn-group">
                        <div class="all_product open">
                            <div data-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="true">
                                全部商品分类 <span class="caret"></span>
                            </div>
                            <ul class="dropdown-menu bga" style="height:unset;">
                                {foreach $cates as $key=>$value }
                                    <li>
                                        <a href="{:url('product/product')}?c_id={$value.id}">
                                            <div class="fl">
                                                <p>{$value.catename}</p>
                                                <p class="gray">{$value.intro}</p>
                                            </div>
                                            <span class="glyphicon glyphicon-menu-right fr"></span>
                                        </a>
                                    </li>
                                {/foreach}
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="fr">
                    <ul>
                        <li><a href="{:url('index/index')}">商城首页</a></li>
                        <li><a href="{:url('product/product')}">农副产品</a></li>
                        <li><a href="{:url('scenic/scenic')}?flag_type=0">景区门票</a></li>
                        <li><a href="{:url('scenic/scenic')}?flag_type=2">免费景区</a></li>
                        <li><a href="{:url('product/product')}?discount=1">折扣专区</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </header>
    <!-- banner -->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            {foreach $banners as $key=>$value }
                <li style="border-color:#eee;" data-target="#carousel-example-generic" data-slide-to="{$key}" class="{if $key==0}active{/if}"></li>
            {/foreach}
        </ol>
        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">
            {foreach $banners as $key=>$value }
                <div class="item {if $key==0}active{/if}">
                    <!-- <a href="{:url('product/product_detail')}?id={$value.p_id}"> -->
                        <img src="{$value.img_pc}">
                    <!-- </a> -->
                    <div class="carousel-caption">
                    </div>
                </div>
            {/foreach}
        </div>
    </div>
    <!-- 菜单 -->
    <div class="home_menu typearea row">
        <div class="menu_item col-xs-6 col-sm-4 col-md-3 col-lg-2">
            <div>农副产品</div>
            <div>选择原产地，健康源于自然</div>
            <div><a href="{:url('product/product')}">点击进入</a></div>
        </div>
        <div class="menu_item col-xs-6 col-sm-4 col-md-3 col-lg-2">
            <div>免票景区</div>
            <div>选择原产地，健康源于自然</div>
            <div><a href="{:url('scenic/scenic')}?flag_type=2">点击进入</a></div>
        </div>
        <div class="menu_item col-xs-6 col-sm-4 col-md-3 col-lg-2">
            <div>景区门票</div>
            <div>选择原产地，健康源于自然</div>
            <div><a href="{:url('scenic/scenic')}">点击进入</a></div>
        </div>
        <div class="menu_item col-xs-6 col-sm-4 col-md-3 col-lg-2">
            <div>折扣专区</div>
            <div>选择原产地，健康源于自然</div>
            <div><a href="{:url('product/product')}?discount=1">点击进入</a></div>
        </div>
    </div>
    <!-- 农副产品 -->
    <div class="home_product">
        <div class="typearea">
            <div class="title">
                <div class="left">
                    <div>农副产品</div>
                    <div>选择原产地,健康源于自然</div>
                </div>
                <div class="fr">
                    <a href="{:url('product/product')}">更多</a>
                </div>
            </div>
            <div class="content">
                <!-- <div class="left">
                    <img src="/static/home/img/p1.jpg" alt="">
                    <div class="left_top">生态水果</div>
                    <ul>
                        <li><a href="">生态水果</a></li>
                        <li><a href="">新鲜蔬菜</a></li>
                        <li><a href="">家禽家畜</a></li>
                        <li><a href="">粮油米面</a></li>
                        <li><a href="">鲜活水产</a></li>
                    </ul>
                </div> -->
                <div class="fr container" style="float:none;">
                    <ul class="row" style="width:unset;">
                        {foreach $products as $key=>$value }
                            <li class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
                                <a href="{:url('product/product_detail')}?id={$value.id}">
                                    <img src="{$value.img}">
                                </a>
                                <div class="name">{$value.title}</div>
                                <div class="price">￥{$value.price}</div>
                            </li>
                        {/foreach}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- 景区门票 -->
    <div class="home_scenic">
        <div class="typearea">
            <div class="title">
                <div class="left">
                    <div>景区门票</div>
                    <div>选择原产地,健康源于自然</div>
                </div>
                <div class="fr">
                    <a href="{:url('scenic/scenic')}">更多</a>
                </div>
            </div>
            <ul class="row">
                {foreach $spots as $key=>$value }
                <li class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
                    <a href="{:url('scenic/scenic_detail')}?id={$value.id}">
                        <img class="li_img" src="{$value.img}" alt="">
                        <div class="li_info">
                            <div>{$value.title}</div>
                            <ul class="stars">
                                {for start="0" end="$value.stars"}
                                <li class="light"><a href="javascript:;"></a></li>
                                {/for}
                                <span style="font-size:14px;" class="c_o">{$value.stars}分</span>
                            </ul>
                            <div><p style="width:130px;margin:unset;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{$value.address}</p> <p style="margin:unset;">距离{$value.distance}m</p></div>
                            <div><span>￥{$value.price}</span></div>
                            <div>门票</div>
                        </div>
                    </a>
                </li>
                {/foreach}
            </ul>
        </div>
    </div>
    <!-- 尾部 -->
    <footer>
        <div class="f_top">
            <div class="typearea">
                <ul>
                    <li>
                        <img src="/static/home/img/b1.jpg" alt="">
                        <span>正品保障</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b2.jpg" alt="">
                        <span>好评如潮</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b3.jpg" alt="">
                        <span>闪电发货</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b4.jpg" alt="">
                        <span>权威荣誉</span>
                    </li>
                </ul>
            </div>
        </div>
        <div class="f_center">
            <div class="typearea">
                <div class="contact">
                    <div class="con_t">
                        <img src="/static/home/img/b5.jpg" alt="">
                        <div class="con_tr ml_10">
                            <div>{$system.ser_tel}</div>
                            <div>服务时间：{$system.ser_time}</div>
                        </div>
                    </div>
                    <div class="mt_20">地址：{$system.address}</div>
                    <div class="mt_20">邮箱：{$system.email}</div>
                </div>
                <ul>
                    <li>购物指南</li>
                    <li><a href="javascript:0">我的购物车</a></li>
                    <li><a href="javascript:0">查看订单</a></li>
                    <li><a href="javascript:0">取消订单</a></li>
                </ul>
                <ul>
                    <li>帮助中心</li>
                    <li><a href="javascript:0">用户注册</a></li>
                    <li><a href="javascript:0">用户登录</a></li>
                    <li><a href="javascript:0">配送说明</a></li>
                </ul>
                <ul>
                    <li>服务保证</li>
                    <li><a href="javascript:0">产品质量保证</a></li>
                    <li><a href="javascript:0">售后服务保证</a></li>
                    <li><a href="javascript:0">联系我们</a></li>
                </ul>
                <div class="fr">
                    <div>
                        <div id="qy_qrcode">
                            
                        </div>
                        <p style="text-align:center;">企业官网</p>
                    </div>
                    <div class="ml_30">
                        <div id="shop_qrcode">
                            
                        </div>
                        <p style="text-align:center;">微信商城</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="f_bottom">
            <div class="typearea">
                版权所有 ©{$system.copyright}&nbsp;&nbsp;&nbsp;&nbsp;{$system.company}&nbsp;&nbsp;&nbsp;&nbsp;{$system.icp}
            </div>
        </div>
    </footer>
    <script src="/static/home/js/bootstrap/jquery.min.js"></script>
    <script src="/static/home/js/bootstrap/bootstrap.min.js"></script>
    <script src="https://webapi.amap.com/maps?v=1.3&key=dd8f6a06a3a36358eea5cd1e1ae00ed1"></script>
    <script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
    <script src="/static/home/js/qrcode.min.js"></script>
    <script type="text/javascript">

        var qrcode = new QRCode(document.getElementById("qy_qrcode"), {
            text: "{$url}/index/index/index.html",
            width: 88,
            height: 88,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });

        var qrcode = new QRCode(document.getElementById("shop_qrcode"), {
            text: "{$url}/h5/index.html",
            width: 88,
            height: 88,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });
        $(function(){
            if(window.localStorage.getItem("Token")){
                $(".login_ing").css("display","none");
                $(".login_ed").css("display","unset");
            }
            $(".login_out").click(function() {
                window.localStorage.setItem("Token",'');
                $(".login_ing").css("display","unset");
                $(".login_ed").css("display","none");
                $.ajax({
                    type: 'POST',
                    url: "{:url('/shop/login/login_out')}",
                    data:{},
                    success: function(data){
                        // window.location.replace(location.href);
                        window.location.reload();
                    },
                    error:function(data) {
                        console.log(data.msg);
                    },
                }); 
            });
        });
        mapObj = new AMap.Map('iCenter');
        mapObj.plugin('AMap.Geolocation', function () {
            geolocation = new AMap.Geolocation({
                enableHighAccuracy: true,//是否使用高精度定位，默认:true
                timeout: 10000,          //超过10秒后停止定位，默认：无穷大
                maximumAge: 0,           //定位结果缓存0毫秒，默认：0
                convert: true,           //自动偏移坐标，偏移后的坐标为高德坐标，默认：true
                showButton: true,        //显示定位按钮，默认：true
                buttonPosition: 'LB',    //定位按钮停靠位置，默认：'LB'，左下角
                buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
                showMarker: true,        //定位成功后在定位到的位置显示点标记，默认：true
                showCircle: true,        //定位成功后用圆圈表示定位精度范围，默认：true
                panToLocation: true,     //定位成功后将定位到的位置作为地图中心点，默认：true
                zoomToAccuracy:true      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
            });
            mapObj.addControl(geolocation);
            geolocation.getCurrentPosition(function(status,result){
                console.log(result.position.lat)
                console.log(result.position.lng)
            });
        });
        $("#search").click(function() {
            layer.load(1, {
              shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            var keyword=$("input[name=keyword]").val();
            window.location.href="{$url}/shop/product/product.html?keyword="+keyword
            ;
        });
    </script>
</body>

</html>